class RegularSubwayRecord : public SubwayRecord
{
   public:
      RegularSubwayRecord(int pdis, int pdur) : SubwayRecord(pdis, pdur)
      {
      
      }
      virtual int fare()
      {
         int price[] = {4,8,10};
         if(duration > 180)
             return 10;
         else
         {
             if(distance <= 20)
                return 4;
             else
             {
                if(distance >50)
                   return 10;
                else
                    return 8;
             
             }
         }
      }
};
class StudentSubwayRecord : public SubwayRecord
{
  public:
      StudentSubwayRecord(int pdis, int pdur) : SubwayRecord(pdis, pdur)
      {
      
      }
      virtual int fare()
      {
         //int price[] = {4,8,10};
         if(duration > 180)
             return 5;
         else
         {
             if(distance <= 20)
                return 2;
             else
             {
                if(distance >50)
                   return 5;
                else
                    return 4;
             
             }
         }
      }
};